from flask import request


def input(keys=None):
    # 请求参数获取

    returns = {}
    for keys in request.values:
        if request.values.get(keys) is None:
            continue
        else:
            returns[keys] = request.values.get(keys)
    if len(returns) is 0:
        try:
            returns = request.get_json()
        except Exception as e:
            return None
    if keys is not None:
        try:
            returns = returns[keys]
        except Exception:
            returns = None
    return returns
